<?php

require_once 'common/conn.php';
if (isset($_GET['start'])) {
    $num = $_GET['start'];
} else {
    $num = 0;
}
if (isset($_GET['limit'])) {
    $count = $_GET['limit'];
}

$data = array();
if (is_numeric($num) && is_numeric($count)) {
    $db = new DBC();
    $sql = "SELECT productid,flashcode,age,name,url,imageURL,version,size,type1 AS type,type2 AS ability,downloadtimes FROM t_product "
            . " WHERE status = 1 AND top = 1 LIMIT " . $num . "," . $count;
    $data = $db->fetchData($sql);
}
echo json_encode($data);
?>